<% layout('/layouts/default.html', {title: '任务接收', libs: ['dataGrid']}){ %>
<div class="main-content">
    <div class="box box-main">
        <div class="box-header">
            <div class="box-tools pull-left" style="position: relative">
                <ul class="nav nav-tabs bangPing-tabs">
                    <li class="active"><a href="${ctx}/backlog/dcSupBacklog/backlogList">${text('待办')}</a></li>
                    <li ><a href="${ctx}/backlog/dcSupBacklog/backlogList1">${text('已办')}</a></li>
                </ul>
            </div>
            <#form:form id="searchForm" model="${dcSupBacklog}" action="${ctx}/backlog/dcSupBacklog/getPage?dataStatus=1" method="post" class="form-inline"
            data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
            <div style="float: right">
                <div class="form-group">
                    <label class="control-label">${text('消息内容')}：</label>
                    <div class="control-inline width-160">
                        <#form:input path="backlogContent" placeholder="请输入消息内容"  maxlength="200" class="form-control width-160"/>
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
                    <button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
                </div>
            </div>
        </#form:form>
    </div>
    <div class="box-body">
        <table id="dataGrid"></table>
        <div id="dataGridPage"></div>
    </div>
</div>
</div>
<% } %>
<script>
    //重置
    function cz(){
        searchForm.reset();
        $('#dataGrid').dataGrid('reloadGrid');
    }

    // 初始化DataGrid对象
    $('#dataGrid').dataGrid({
        searchForm: $("#searchForm"),
        sortableColumn: false, // 列表不允许排序
        columnModel: [
            {header:'${text("id")}', name:'id', width:100, align:"left",hidden:true},
            {header:'${text("消息标题")}', name:'backlogTitle', width:100, align:"left"},
            {header:'${text("消息内容")}', name:'backlogContent', width:300, align:"left", frozen:true},
            {header:'${text("发送者")}', name:'sendUserName', width:100, align:"left"},
            {header:'${text("发送时间")}', name:'createDate', width:100, align:"left"},
            {header:'${text("操作")}', name:'actions', width:150,align:"center", formatter: function(val, obj, row, act){
                    var actions = [];
                    // actions.push('<a href="${ctx}/backlog/dcSupBacklog/backlogView?id='+ row.id+'" class="btn btn-primary btn-xs btnList" title="${text("去办理")}"><span>去办理</span></a>&emsp;');
                    actions.push('<a href="${ctx}'+ row.backlogHref+'" class="btn btn-primary btn-xs btnList" title="${text("去办理")}"><span>去办理</span></a>&emsp;');
                return actions.join('');
            }}

    ],
    // 加载成功后执行事件
    ajaxSuccess: function(data){

    }
    });
</script>